<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MagTwin: test/logger.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">MagTwin<span id="projectnumber">&#160;V0.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_13e138d54eb8818da29c3992edef070a.html">test</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle"><div class="title">logger.h</div></div>
</div><!--header-->
<div class="contents">
<a href="test_2logger_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span><span class="preprocessor">#ifndef LOGGER_H</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="preprocessor">#define LOGGER_H</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span> </div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span><span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span><span class="preprocessor">#include &lt;ctime&gt;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span><span class="preprocessor">#include &lt;sstream&gt;</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span><span class="preprocessor">#include &lt;iomanip&gt;</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span><span class="preprocessor">#include &lt;fstream&gt;</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span> </div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span><span class="keyword">class </span><a class="code hl_class" href="class_mag_logger.html">MagLogger</a> {</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span>    <a class="code hl_class" href="class_mag_logger.html">MagLogger</a>() {}</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span>    <a class="code hl_class" href="class_mag_logger.html">~MagLogger</a>() {} </div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span>    std::string currentTime();</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"><a class="line" href="class_mag_logger.html#aa52e41fe1302a56ec26856cd062b291f">   35</a></span>    <span class="keywordtype">void</span> <a class="code hl_function" href="class_mag_logger.html#aa52e41fe1302a56ec26856cd062b291f">debug</a>(<span class="keyword">const</span> std::string&amp; message);</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"><a class="line" href="class_mag_logger.html#adc2763b218ec03d8ecbb6bf00cc64a28">   42</a></span>    <span class="keywordtype">void</span> <a class="code hl_function" href="class_mag_logger.html#adc2763b218ec03d8ecbb6bf00cc64a28">info</a>(<span class="keyword">const</span> std::string&amp; message);</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"><a class="line" href="class_mag_logger.html#abacc186e35e7a98e37edd8981c19454d">   49</a></span>    <span class="keywordtype">void</span> <a class="code hl_function" href="class_mag_logger.html#abacc186e35e7a98e37edd8981c19454d">warning</a>(<span class="keyword">const</span> std::string&amp; message);</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"><a class="line" href="class_mag_logger.html#a4dc582a17edb8e04890939de3be12880">   56</a></span>    <span class="keywordtype">void</span> <a class="code hl_function" href="class_mag_logger.html#a4dc582a17edb8e04890939de3be12880">error</a>(<span class="keyword">const</span> std::string&amp; message);</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"><a class="line" href="class_mag_logger.html#a8f2476196fafaf6bd65c9da863a7d059">   63</a></span>    <span class="keywordtype">void</span> <a class="code hl_function" href="class_mag_logger.html#a8f2476196fafaf6bd65c9da863a7d059">fatal</a>(<span class="keyword">const</span> std::string&amp; message);</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno">   64</span> </div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno">   65</span>    std::vector&lt;std::string&gt;&amp; getDebugLog() { <span class="keywordflow">return</span> debugLog; }</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno">   66</span>    std::vector&lt;std::string&gt;&amp; getInfoLog() { <span class="keywordflow">return</span> infoLog; }</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno">   67</span>    std::vector&lt;std::string&gt;&amp; getWarningLog() { <span class="keywordflow">return</span> warningLog; }</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno">   68</span>    std::vector&lt;std::string&gt;&amp; getErrorLog() { <span class="keywordflow">return</span> errorLog; }</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno">   69</span>    std::vector&lt;std::string&gt;&amp; getFatalLog() { <span class="keywordflow">return</span> fatalLog; }</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno">   70</span>    std::vector&lt;std::string&gt;&amp; getAllLog() { <span class="keywordflow">return</span> magAllLog; }</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno">   71</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno">   72</span>    <span class="keywordtype">void</span> exportLog(<span class="keyword">const</span> std::string&amp; fileName);</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno">   73</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno">   74</span>    std::vector&lt;std::string&gt; magAllLog;</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno">   75</span>    std::vector&lt;std::string&gt; debugLog;</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno">   76</span>    std::vector&lt;std::string&gt; infoLog;</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno">   77</span>    std::vector&lt;std::string&gt; warningLog;</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno">   78</span>    std::vector&lt;std::string&gt; errorLog;</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno">   79</span>    std::vector&lt;std::string&gt; fatalLog;</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno">   80</span>};</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno">   81</span> </div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno">   82</span><span class="preprocessor">#endif </span><span class="comment">// LOGGER_H</span></div>
<div class="ttc" id="aclass_mag_logger_html"><div class="ttname"><a href="class_mag_logger.html">MagLogger</a></div><div class="ttdoc">MagLogger类用于记录日志信息.</div><div class="ttdef"><b>Definition</b> logger.h:12</div></div>
<div class="ttc" id="aclass_mag_logger_html_a4dc582a17edb8e04890939de3be12880"><div class="ttname"><a href="class_mag_logger.html#a4dc582a17edb8e04890939de3be12880">MagLogger::error</a></div><div class="ttdeci">void error(const std::string &amp;message)</div><div class="ttdoc">debug 错误信息</div></div>
<div class="ttc" id="aclass_mag_logger_html_a8f2476196fafaf6bd65c9da863a7d059"><div class="ttname"><a href="class_mag_logger.html#a8f2476196fafaf6bd65c9da863a7d059">MagLogger::fatal</a></div><div class="ttdeci">void fatal(const std::string &amp;message)</div><div class="ttdoc">debug 致命信息</div></div>
<div class="ttc" id="aclass_mag_logger_html_aa52e41fe1302a56ec26856cd062b291f"><div class="ttname"><a href="class_mag_logger.html#aa52e41fe1302a56ec26856cd062b291f">MagLogger::debug</a></div><div class="ttdeci">void debug(const std::string &amp;message)</div><div class="ttdoc">A demo function in DemoClass.</div></div>
<div class="ttc" id="aclass_mag_logger_html_abacc186e35e7a98e37edd8981c19454d"><div class="ttname"><a href="class_mag_logger.html#abacc186e35e7a98e37edd8981c19454d">MagLogger::warning</a></div><div class="ttdeci">void warning(const std::string &amp;message)</div><div class="ttdoc">debug 警告信息</div></div>
<div class="ttc" id="aclass_mag_logger_html_adc2763b218ec03d8ecbb6bf00cc64a28"><div class="ttname"><a href="class_mag_logger.html#adc2763b218ec03d8ecbb6bf00cc64a28">MagLogger::info</a></div><div class="ttdeci">void info(const std::string &amp;message)</div><div class="ttdoc">debug 一般信息</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>
